import { computed } from 'vue'
import getMenus from './getMenus'
export default props => {
    const id = computed(() => props.id - 0)
    const childId = computed(() => props.subid - 0)
    const isChannelIndex = computed(() => id.value && !childId.value)
    const currentPath = computed(() => {
        let path = `/channel/${id.value}` 
        if (!isChannelIndex.value) {
            path += `${childId.value !== 0 ? ('/' + childId.value) : ''}`
        }
        return path
    })
    // 获取频道下面的二级菜单
    const menus = computed(() => getMenus(id.value))
                 
    return {
        menus,
        currentPath
    }
}